/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mosipdkara
 */
@Entity
@Table(name = "talepedilenis")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Talepedilenis.findAll", query = "SELECT t FROM Talepedilenis t"),
    @NamedQuery(name = "Talepedilenis.findByTalepId", query = "SELECT t FROM Talepedilenis t WHERE t.talepId = :talepId"),
    @NamedQuery(name = "Talepedilenis.findByTalepTarih", query = "SELECT t FROM Talepedilenis t WHERE t.talepTarih = :talepTarih"),
    @NamedQuery(name = "Talepedilenis.findByTalepAciklama", query = "SELECT t FROM Talepedilenis t WHERE t.talepAciklama = :talepAciklama")})
public class Talepedilenis implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TalepId")
    private Integer talepId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TalepTarih")
    @Temporal(TemporalType.TIMESTAMP)
    private Date talepTarih;
    @Size(max = 345)
    @Column(name = "TalepAciklama")
    private String talepAciklama;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "talepEdilenIsId")
    private List<Iskayit> iskayitList;
    @JoinColumn(name = "TalepDetayIsId", referencedColumnName = "DetayIsId")
    @ManyToOne(optional = false)
    private Detayis talepDetayIsId;
    @JoinColumn(name = "TalepUstlenenPersonelId", referencedColumnName = "PersonelId")
    @ManyToOne(optional = false)
    private Personel talepUstlenenPersonelId;
    @JoinColumn(name = "TalepEdenPersonelId", referencedColumnName = "PersonelId")
    @ManyToOne(optional = false)
    private Personel talepEdenPersonelId;
    @JoinColumn(name = "TalepIsDurumId", referencedColumnName = "IsDurumId")
    @ManyToOne(optional = false)
    private Isdurumu talepIsDurumId;

    public Talepedilenis() {
    }

    public Talepedilenis(Integer talepId) {
        this.talepId = talepId;
    }

    public Talepedilenis(Integer talepId, Date talepTarih) {
        this.talepId = talepId;
        this.talepTarih = talepTarih;
    }

    public Integer getTalepId() {
        return talepId;
    }

    public void setTalepId(Integer talepId) {
        this.talepId = talepId;
    }

    public Date getTalepTarih() {
        return talepTarih;
    }

    public void setTalepTarih(Date talepTarih) {
        this.talepTarih = talepTarih;
    }

    public String getTalepAciklama() {
        return talepAciklama;
    }

    public void setTalepAciklama(String talepAciklama) {
        this.talepAciklama = talepAciklama;
    }

    @XmlTransient
    public List<Iskayit> getIskayitList() {
        return iskayitList;
    }

    public void setIskayitList(List<Iskayit> iskayitList) {
        this.iskayitList = iskayitList;
    }

    public Detayis getTalepDetayIsId() {
        return talepDetayIsId;
    }

    public void setTalepDetayIsId(Detayis talepDetayIsId) {
        this.talepDetayIsId = talepDetayIsId;
    }

    public Personel getTalepUstlenenPersonelId() {
        return talepUstlenenPersonelId;
    }

    public void setTalepUstlenenPersonelId(Personel talepUstlenenPersonelId) {
        this.talepUstlenenPersonelId = talepUstlenenPersonelId;
    }

    public Personel getTalepEdenPersonelId() {
        return talepEdenPersonelId;
    }

    public void setTalepEdenPersonelId(Personel talepEdenPersonelId) {
        this.talepEdenPersonelId = talepEdenPersonelId;
    }

    public Isdurumu getTalepIsDurumId() {
        return talepIsDurumId;
    }

    public void setTalepIsDurumId(Isdurumu talepIsDurumId) {
        this.talepIsDurumId = talepIsDurumId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (talepId != null ? talepId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Talepedilenis)) {
            return false;
        }
        Talepedilenis other = (Talepedilenis) object;
        if ((this.talepId == null && other.talepId != null) || (this.talepId != null && !this.talepId.equals(other.talepId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Talepedilenis[ talepId=" + talepId + " ]";
    }
    
}
